Extracting a formally verified Subtyping Algorithm for Intersection Types from Ideals and Filters
نویسندگان
چکیده
The BCD type system of intersection types has been introduced by Barendregt, Coppo and Dezani in [1]. It is derived from a filter lambda model in order to characterize exactly the strongly normalizing terms. Formally, intersection types over variables α ∈ V σ, τ, ρ ::= α | σ → τ | σ ∩ τ | ω are related by the least preorder ≤ closed under the rules σ ≤ ω, ω ≤ ω → ω, σ ∩ τ ≤ σ, σ ∩ τ ≤ τ, σ ≤ σ ∩ σ; (σ → τ) ∩ (σ → ρ) ≤ σ → τ ∩ ρ; If σ ≤ σ and τ ≤ τ ′ then σ ∩ τ ≤ σ ∩ τ ′ and σ → τ ≤ σ → τ . Decidability of this preorder has been shown in [6, 4, 7, 8]. Laurent has formalized the relation in Coq in order to eliminate transitivity cuts from it [5]. Following the ideas presented in [8], we show how to obtain a formally verified subtyping algorithm in Coq. Focusing on the algebraic properties of filters and ideals on the subtype relation, we manage to avoid additional proof infrastructure (e.g. lists of types) and extensions to the core type theory of Coq. When executed inside Coq, the algorithm produces a subtype proof tree for an arbitrary pair of intersection types or a counter proof if the input pair is not subtype related. Automatic program extraction allows to obtain Haskell and OCaml versions of the algorithm. Extracted code can be used as a reference for randomized testing of manually optimized implementations. We will report on an implemented but not yet machine verified subtype algorithm with O(n) asymptotic runtime behavior. Proven properties allow to formally show the correspondence between prime ideals and the notion of paths in intersection types, which is mentioned in [9]. Organization into an intersection of paths is an important lemma in proofs for various decision problems, e.g. type inhabitation [3], type matching [2] and type inference [4]. We will demonstrate our implementation and made it publicly available in the hope that it can serve as a platform for exploring formal verification and program extraction of algorithms based on intersection types.
منابع مشابه
Zero sets in pointfree topology and strongly $z$-ideals
In this paper a particular case of z-ideals, called strongly z-ideal, is defined by introducing zero sets in pointfree topology. We study strongly z-ideals, their relation with z-ideals and the role of spatiality in this relation. For strongly z-ideals, we analyze prime ideals using the concept of zero sets. Moreover, it is proven that the intersection of all zero sets of a prime ideal of C(L),...
متن کاملSubtyping in Logical Form
By using intersection types and filter models we formulate a theory of types for a λ-calculus with record subtyping via a finitary programming logic. Types are interpreted as spaces of filters over a subset of the language of properties (the intersection types) which describes the underlying type free realizability structure. We show that such an interpretation is a PER semantics, proving that ...
متن کاملDecidability of Higher-Order Subtyping with Intersection Types
The combination of higher-order subtyping with intersection types yields a typed model of object-oriented programming with multiple inheritance 11]. The target calculus, F ! ^ , a natural generalization of Girard's system F ! with intersection types and bounded polymorphism, is of independent interest, and is our subject of study. Our main contribution is the proof that subtyping in F ! ^ is de...
متن کاملIntersection Types and Bounded Polymorphism
Intersection types and bounded quantiication are complementary extensions of a rst-order programming language with subtyping. We deene a typed-calculus combining these extensions, illustrate its unusual properties, and develop basic proof-theoretic and semantic results leading to algorithms for subtyping and typechecking.
متن کاملLocal Cohomology with Respect to a Cohomologically Complete Intersection Pair of Ideals
Let $(R,fm,k)$ be a local Gorenstein ring of dimension $n$. Let $H_{I,J}^i(R)$ be the local cohomology with respect to a pair of ideals $I,J$ and $c$ be the $inf{i|H_{I,J}^i(R)neq0}$. A pair of ideals $I, J$ is called cohomologically complete intersection if $H_{I,J}^i(R)=0$ for all $ineq c$. It is shown that, when $H_{I,J}^i(R)=0$ for all $ineq c$, (i) a minimal injective resolution of $H_{I,...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2016